<html>
<head>
<title>图片广告交替显示</title>
<script language="JavaScript" type="text/JavaScript">
<!--
var urlArray = new Array(3); 
var banArray = new Array(3); 
var counter = 1;
var url = "http://www.youa.com"; //initial URL

urlArray[0] = "http://www.youa.com";
urlArray[1] = "http://www.baidu.com/";
urlArray[2] = "http://www.163.com";

if(document.images) 
{
  for(i = 0; i < 3; i++)
  {
    banArray[i] = new Image(468, 60);
    banArray[i].src = "/jscss/demoimg/wall_s" + (i+1) + ".jpg";
  }
}


function changeBanner() 
{
  if(counter > 2)
   counter = 0;

  document.banner.src = banArray[counter].src; //sets a new banner

  url = urlArray[counter]; 
  counter++; 
}
var timer = window.setInterval("changeBanner()", 3000);

//-->
</script>
</head>
<body>
<a href="#" onClick="window.open(url,'BannerWin');"><img src="/jscss/demoimg/wall_s1.jpg" width=468 height=60 border=0 name="banner"></a>
</body>
</html>
